SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
CREATE VIEW dbo.vw_Servicios
AS
SELECT documento, ids, MAX(idss) AS maxidss, MIN(FAlta) 
    AS FAlta, MIN(CONVERT(smallint, Baja)) AS Baja, MAX(FBaja) 
    AS FBaja, MIN(Cargo) AS Cargo, MIN(Asignatura) 
    AS Asignatura, MAX(horas) AS horas, MIN(ResAlta) AS ResAlta, 
    MAX(resBaja) AS ResBaja, MAX(Cuise) AS cuise, MAX(sitrev) 
    AS sitrev
FROM serviciosPrestados
WHERE sitlab <> 'LE'
GROUP BY documento, ids





GO
GRANT SELECT ON  [dbo].[vw_Servicios] TO [SoloVer]
GO
